package com.shanshan.crowd.mvc.controller;

import com.shanshan.crowd.service.api.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Description
 * @ClassName TestController
 * @Author 山山大魔王
 * @Date 2022/7/19 17:36
 * @Version 1.0
 */
@Controller
public class TestController {

    @Autowired
    private AdminService adminService;


    @RequestMapping("/index.html")
    public String index(){
        return "index";
    }

    @RequestMapping("/test/ssm.html")
    public ModelAndView testSsm(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("target");
        System.out.println(10/0);
        modelAndView.addObject("test", adminService.getAll());
        return modelAndView;
    }
}
